﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class team_profile : System.Web.UI.Page
{
    protected Team tea;
    protected void Page_Load(object sender, EventArgs e)
    {
        tea = Team.Check();
        if (tea == null)
        {
            Session.Add(Params.SystemError, "请先登录");
            Response.Redirect(Params.RootHttp + "default.aspx");
        }
        if (!Page.IsPostBack)
        {
            this.MyDataBind();
        }
    }

    public void MyDataBind()
    {
        this.Title = this.tea.RealName + "-个人信息";
        this.conNav.Title = "个人信息";
        this.tbEmail.Text = tea.Email;
        this.tbYjfx.Text = this.tea.Yjfx;
    }

    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        string email = this.tbEmail.Text.Trim();
        string yjfx = this.tbYjfx.Text.Trim();
        if (email == "")
        {
            this.info.SetMessage("邮箱名不能为空！");
            return;
        }
        if (yjfx == "")
        {
            this.info.SetMessage("研究方向不能为空！");
            return;
        }
        this.tea.Email = email;
        this.tea.Yjfx = yjfx;
        this.tea.Update();
        this.info.SetMessage("修改成功！");
    }
}
